package org.jeecg.modules.bigdatashow.service.impl;

import org.jeecg.modules.bigdatashow.entity.*;
import org.jeecg.modules.bigdatashow.mapper.TakeOrderMapper;
import org.jeecg.modules.bigdatashow.service.TakeOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: TODO
 * @author: scott
 * @date: 2022年03月04日 10:26
 */
@Service
public class TakeOrderServiceImpl implements TakeOrderService {
    @Autowired
    TakeOrderMapper takeOrderMapper;
    @Override
    public List<TakeOrder> findAllTakeOrders() {
        return takeOrderMapper.findAllTakeOrders();
    }

    @Override
    public List<DailyOrderQuantityInJanuary> findDailyOrderQuantityInJanuary() {
        return takeOrderMapper.findDailyOrderQuantityInJanuary();
    }

    @Override
    public List<EveryMonthOrderAmountAndReturnAmount> findEveryMonthOrderAmountAndReturnAmount() {
        return takeOrderMapper.findEveryMonthOrderAmountAndReturnAmount();
    }

    @Override
    public List<EveryMonthOrderAmount> findEveryMonthOrderAmount() {
        return takeOrderMapper.findEveryMonthOrderAmount();
    }

    @Override
    public List<EveryOrderTypeAmount> findEveryOrderTypeAmount() {
        return takeOrderMapper.findEveryOrderTypeAmount();
    }

    @Override
    public EverySeasonOrderAmount findEverySeasonOrderAmount() {
        EverySeasonOrderAmount everyOrderTypeAmount = new EverySeasonOrderAmount();
        int springAmount = takeOrderMapper.findSpringOrderAmount();
        int summerAmount = takeOrderMapper.findSummerOrderAmount();
        int autumnAmount = takeOrderMapper.findAutumnOrderAmount();
        int winterAmount = takeOrderMapper.findWinterOrderAmount();
        everyOrderTypeAmount.setSpringAmount(springAmount);
        everyOrderTypeAmount.setSummerAmount(summerAmount);
        everyOrderTypeAmount.setAutumnAmount(autumnAmount);
        everyOrderTypeAmount.setWinterAmount(winterAmount);
        return everyOrderTypeAmount;
    }

    @Override
    public List<EveryWeekOrderTrafficAmount> findEveryWeekOrderTrafficAmount() {
        return takeOrderMapper.findEveryWeekOrderTrafficAmount();
    }
}
